<%@ page import="java.util.Date" %>
<%@ page import="com.javaweb.common.StringTool" %><%--
  Function: 
  User: PING
  Date: 2022/9/22

--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    /**
     * Get date from the JSP object
     */
    // 1. get data from Request
 /*   String name = (String) request.getAttribute("name") ;
    Date time = (Date) request.getAttribute("time") ;*/
    // 2. get data from Session
 /*   String name = (String) session.getAttribute("name") ;
    Date time = (Date) session.getAttribute("time") ;
    String sid = session.getId() ;
    out.println("SID: " + sid) ;*/

    // 3. get data from Application
    String name = (String) application.getAttribute("name") ;
    Date time = (Date) application.getAttribute("time") ;

%>


<html>
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .show {
            box-sizing: border-box;
            border-radius: 10px;
            width:450px;
            height: 200px;
            background-color:#eeeeee;
            margin:50px auto;
            padding:20px;
            font-size:24px;
        }
        .show p {
            float:left;
            text-align: center;
        }

    </style>


</head>
<body>
<div class="show">
    <p>名字： <%= name %><p></p>
    <p>时间： <%=StringTool.formatTime(time)%></p>
</div>

</body>
</html>
